3.1.64 \(\int \frac {\tan (c+d x)}{(a+a \sin (c+d x))^2} \, dx\) [64]

Optimal. Leaf size=60 \[ \frac {\tanh ^{-1}(\sin (c+d x))}{4 a^2 d}+\frac {1}{4 d (a+a \sin (c+d x))^2}-\frac {1}{4 d \left (a^2+a^2 \sin (c+d x)\right )} \]

[Out]

1/4*arctanh(sin(d*x+c))/a^2/d+1/4/d/(a+a*sin(d*x+c))^2-1/4/d/(a^2+a^2*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {2786, 78, 212} \begin {gather*} -\frac {1}{4 d \left (a^2 \sin (c+d x)+a^2\right )}+\frac {\tanh ^{-1}(\sin (c+d x))}{4 a^2 d}+\frac {1}{4 d (a \sin (c+d x)+a)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + a*Sin[c + d*x])^2,x]

[Out]

ArcTanh[Sin[c + d*x]]/(4*a^2*d) + 1/(4*d*(a + a*Sin[c + d*x])^2) - 1/(4*d*(a^2 + a^2*Sin[c + d*x]))

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \frac {\tan (c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac {\text {Subst}\left (\int \frac {x}{(a-x) (a+x)^3} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (-\frac {1}{2 (a+x)^3}+\frac {1}{4 a (a+x)^2}+\frac {1}{4 a \left (a^2-x^2\right )}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {1}{4 d (a+a \sin (c+d x))^2}-\frac {1}{4 d \left (a^2+a^2 \sin (c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,a \sin (c+d x)\right )}{4 a d}\\ &=\frac {\tanh ^{-1}(\sin (c+d x))}{4 a^2 d}+\frac {1}{4 d (a+a \sin (c+d x))^2}-\frac {1}{4 d \left (a^2+a^2 \sin (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 36, normalized size = 0.60 \begin {gather*} \frac {\tanh ^{-1}(\sin (c+d x))-\frac {\sin (c+d x)}{(1+\sin (c+d x))^2}}{4 a^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + a*Sin[c + d*x])^2,x]

[Out]

(ArcTanh[Sin[c + d*x]] - Sin[c + d*x]/(1 + Sin[c + d*x])^2)/(4*a^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.22, size = 55, normalized size = 0.92

method result size
derivativedivides \(\frac {-\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{8}+\frac {1}{4 \left (1+\sin \left (d x +c \right )\right )^{2}}-\frac {1}{4 \left (1+\sin \left (d x +c \right )\right )}+\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{8}}{d \,a^{2}}\) \(55\)
default \(\frac {-\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{8}+\frac {1}{4 \left (1+\sin \left (d x +c \right )\right )^{2}}-\frac {1}{4 \left (1+\sin \left (d x +c \right )\right )}+\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{8}}{d \,a^{2}}\) \(55\)
risch \(-\frac {i \left ({\mathrm e}^{3 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}\right )}{2 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{4}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{4 a^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{4 a^{2} d}\) \(88\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d/a^2*(-1/8*ln(sin(d*x+c)-1)+1/4/(1+sin(d*x+c))^2-1/4/(1+sin(d*x+c))+1/8*ln(1+sin(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 70, normalized size = 1.17 \begin {gather*} -\frac {\frac {2 \, \sin \left (d x + c\right )}{a^{2} \sin \left (d x + c\right )^{2} + 2 \, a^{2} \sin \left (d x + c\right ) + a^{2}} - \frac {\log \left (\sin \left (d x + c\right ) + 1\right )}{a^{2}} + \frac {\log \left (\sin \left (d x + c\right ) - 1\right )}{a^{2}}}{8 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/8*(2*sin(d*x + c)/(a^2*sin(d*x + c)^2 + 2*a^2*sin(d*x + c) + a^2) - log(sin(d*x + c) + 1)/a^2 + log(sin(d*x
 + c) - 1)/a^2)/d

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 104, normalized size = 1.73 \begin {gather*} \frac {{\left (\cos \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) - 2\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (\cos \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) - 2\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, \sin \left (d x + c\right )}{8 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - 2 \, a^{2} d \sin \left (d x + c\right ) - 2 \, a^{2} d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/8*((cos(d*x + c)^2 - 2*sin(d*x + c) - 2)*log(sin(d*x + c) + 1) - (cos(d*x + c)^2 - 2*sin(d*x + c) - 2)*log(-
sin(d*x + c) + 1) + 2*sin(d*x + c))/(a^2*d*cos(d*x + c)^2 - 2*a^2*d*sin(d*x + c) - 2*a^2*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan {\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+a*sin(d*x+c))**2,x)

[Out]

Integral(tan(c + d*x)/(sin(c + d*x)**2 + 2*sin(c + d*x) + 1), x)/a**2

________________________________________________________________________________________

Giac [A]
time = 4.27, size = 90, normalized size = 1.50 \begin {gather*} \frac {\frac {\log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) + 2 \right |}\right )}{a^{2}} - \frac {\log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) - 2 \right |}\right )}{a^{2}} - \frac {\frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) + 6}{a^{2} {\left (\frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) + 2\right )}}}{16 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/16*(log(abs(1/sin(d*x + c) + sin(d*x + c) + 2))/a^2 - log(abs(1/sin(d*x + c) + sin(d*x + c) - 2))/a^2 - (1/s
in(d*x + c) + sin(d*x + c) + 6)/(a^2*(1/sin(d*x + c) + sin(d*x + c) + 2)))/d

________________________________________________________________________________________

Mupad [B]
time = 7.64, size = 116, normalized size = 1.93 \begin {gather*} \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,a^2\,d}-\frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+6\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a^2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)/(a + a*sin(c + d*x))^2,x)

[Out]

atanh(tan(c/2 + (d*x)/2))/(2*a^2*d) - (tan(c/2 + (d*x)/2)/2 + tan(c/2 + (d*x)/2)^3/2)/(d*(6*a^2*tan(c/2 + (d*x
)/2)^2 + 4*a^2*tan(c/2 + (d*x)/2)^3 + a^2*tan(c/2 + (d*x)/2)^4 + a^2 + 4*a^2*tan(c/2 + (d*x)/2)))

________________________________________________________________________________________